home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-09-07 | 825 b | 31 lines | [TEXT/KEEN] |
- #$LookupTest - try out the "lookup" built-in function, implemented
- #by EnterAct. Requires a project with a built dictionary to be open
- #at the time - use on any source code from the project.
-
- {
- gsub(/[^A-Za-z_]/, " ")#crude, but this is just a test
- for (i = 1; i <= NF; ++i)
- {
- type = lookup($i)
- if (type == 1)
- print $i, "is a define"
- else if (type == 2)
- print $i, "is a file-scope variable"
- else if (type == 4)
- print $i, "is a function"
- else if (type == 8)
- print $i, "is an enum constant"
- else if (type == 16)
- print $i, "is a typedef"
- else if (type == 32)
- print $i, "is a struct tag"
- else if (type == 64)
- print $i, "is a union tag"
- else if (type == 128)
- print $i, "is an enum tag"
- else if (type == 0)
- print $i, "is something else"
- else
- print $i, "not looked up"
- }
- }